package merchant.space;

import android.util.Log;


public class Navigation {

	public static final int OFFLINE = 0;
	public static final int FBLOGGEDIN = 1;
	public static final int LOGGEDIN = 2;
	public static final int LOGGEDOUT =3;
	public static final int FBLOGGEDOUT =4;
	
	private int status;
	private int id;
	private String name,mail;
	private boolean mycollectionsrefresh;
	private String pass;
	
	
	public void setName(String s)
	{ 
		name=s;
	}
	
	public String getName()
	{ 
		return name;
	}
	
	public void setMail(String e)
	{ 
		mail=e;
	}
	
	public String getMail()
	{ 
		return mail;
	}
	public void setPassword(String p)
	{ 
		pass=p;
	}
	
	public String getPassword()
	{ 
		return pass;
	}
		
	public String stringStatus()
	{
		String ret="start";
		switch (status)
		{
		
		case OFFLINE: ret= "Offline"; break;
		case FBLOGGEDIN: ret= "Logged by Facebook"; break;
		case FBLOGGEDOUT: ret= "Logout by Facebook"; break;
		case LOGGEDIN: ret="Logged in"; break;
		}
		return ret;
	}
	public Navigation()
	{
		status=OFFLINE;
		id=-1;
		name=null;
		//createCollection();
		mycollectionsrefresh=false;
		Log.d("CREATING NAV","NAV");
	}
	
	public void fblogin()
	{
		status=FBLOGGEDIN;
		mycollectionsrefresh=true;
	}
	
	public void fblogout()
	{
		status=FBLOGGEDOUT;
		mycollectionsrefresh=true;
	}
	
	public void logout()
	{
		status=OFFLINE;
		mycollectionsrefresh=true;
	}
	
	public void login(String name,String email,String pass,int id)
	{
		status=LOGGEDIN;
		mycollectionsrefresh=true;
		this.name=name;
		this.mail=email;
		this.pass=pass;
		this.id=id;
	}
	
	public int getId() { return id; }
	
	public int getStatus()
	{
		return status;
	}
	
	public boolean myCollectionsRefresh()
	{
		return mycollectionsrefresh;
		
	}
	
	public void setCollectionsRefresh(boolean bool)
	{
		mycollectionsrefresh = bool;
		
	}
	
}
